﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PRE.catalog
{
    public partial class Frmdangnhap : Form
    {
        DAL.DangnhapDAL _dal = new DAL.DangnhapDAL();
        public Frmdangnhap()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            txtmatkhau.Text = "";
            txttaikhoan.Text = "";
          
            
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Exit();
        }

        private void simpleButton3_Click(object sender, EventArgs e)
        {
            var sss = (new BLL.ThanhvienBLL()).CheckLogin(txttaikhoan.Text, txtmatkhau.Text);
            if (sss.Login)
            {
                Form1._sss = sss;
                //MessageBox.Show("dang nhap thanh cong", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Close();
                // break;
            }
            else
            {
                MessageBox.Show("Lỗi! Tài khoản hoặc mật khẩu không đúng", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //                y = x + y;
                //  FrmLogin_Load(sender, e);
                //  break;
            }
        }

        private void Frmdangnhap_Load(object sender, EventArgs e)
        {

        }
    }
}
